/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package DataModel;

import java.util.Date;
import java.util.LinkedList;

/**
 *
 * @author Rainiero
 */
public class ActivitySummary {

    // <editor-fold defaultstate="collapsed" desc="Attributes">
    private int _id;
    private String _name;
    private String _parentName;
    private Date _estimatedStart;
    private Date _estimatedEnd;
    private double _estimatedBudget;
    private double _completed;
    private LinkedList<ActivitySummary> _children;
    // </editor-fold>

    // <editor-fold defaultstate="collapsed" desc="Constructor">
    public ActivitySummary(int id, String name, String parentName, Date estimatedStart, Date estimatedEnd, double estimatedBudget, double completed) {
        this._id = id;
        this._name = name;
        this._parentName = parentName;
        this._estimatedStart = estimatedStart;
        this._estimatedEnd = estimatedEnd;
        this._estimatedBudget = estimatedBudget;
        this._completed = completed;
        _children = new LinkedList<ActivitySummary>();
    }
    // </editor-fold>

    // <editor-fold defaultstate="collapsed" desc="Properties">
    public int getId() {
        return _id;
    }

    public String getName() {
        return _name;
    }

    public double getEstimatedBudget() {
        return _estimatedBudget;
    }

    public Date getEstimatedEnd() {
        return _estimatedEnd;
    }

    public Date getEstimatedStart() {
        return _estimatedStart;
    }

    public String getParentName() {
        return _parentName;
    }

    public ActivitySummary AddChild(ActivitySummary child)
    {
        _children.add(child);
        return child;
    }

    public ActivitySummary[] getChildren()
    {
        ActivitySummary[] result = new ActivitySummary[_children.size()];
        return _children.toArray(result);
    }

    public double getCompleted() {
        return _completed;
    }
    // </editor-fold>

}
